import { Module } from "vuex";

import { IEchartsData } from "./type";
import { IRootState } from "@/store/types";
import {
  getcategoryGoodsCount,
  getcategoryGoodsSale,
  getcategoryGoodsFavor,
  getaddressGoodsSale
} from "@/service/main/index/echartData";
const echartDataModule: Module<IEchartsData, IRootState> = {
  namespaced: true,
  state() {
    return {
      categoryGoodsCount: [],
      categoryGoodsSale: [],
      categoryGoodsFavor: [],
      addressGoodsSale: []
    };
  },
  mutations: {},
  actions: {
    async getechartsDataAction({ commit }) {
      await getcategoryGoodsCount();
    },
    async getcategoryGoodsSaleAction({ commit }) {
      await getcategoryGoodsSale();
    },
    async getcategoryGoodsFavorAction({ commit }) {
      await getcategoryGoodsFavor();
    },
    async getaddressGoodsSaleAction({ commit }) {
      await getaddressGoodsSale();
    }
  }
};
export default echartDataModule;
